package com.example.druiddemo.controller;

import com.example.druiddemo.mapper.mybase001.RpcUrlMapper1;
import com.example.druiddemo.mapper.mybase002.RpcUrlMapper2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MybatisController {

    @Autowired
    private RpcUrlMapper1 mapper1;

    @Autowired
    private RpcUrlMapper2 mapper2;

    @GetMapping("/queryByMybatis/{id}")
    public String getData(@PathVariable int id){
        return mapper1.queryUrlById(id).toString();
    }

    @GetMapping("/queryByMybatis2/{id}")
    public String getData2(@PathVariable int id){
        return mapper2.queryUrlById(id).toString();
    }

}
